package com.ljq.anonymousInnerClassAndAPIs;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;

/**
 * Description: 常用api4
 * Author: A
 * Date: 2025/2/25
 * Time: 9:55
 */
public class APIs4 {
    public static void main(String[] args) {
        foo();
    }

    public static void foo(){
        ArrayList<String> coll = new ArrayList<>();
        //2. 将字符串数据加到集合中
        coll.add("JavaEE企业级开发指南");
        coll.add("Oracle高级编程");
        coll.add("MySQL从入门到精通");
        coll.add("Java架构师之路");
        Iterator<String> iterator = coll.iterator();
        while (iterator.hasNext()){
            System.out.println();
            String book = iterator.next();
            if(book.contains("Java架构师之路")){
                iterator.remove();
            }
        }
        Iterator<String> iter5 = coll.iterator();
        while (iter5.hasNext()) {
            String book = iter5.next();
            System.out.println(book);
        }
    }

}
